﻿using System;
using System.Collections.Generic;
using System.Text;

namespace XhPaper.基本图形
{
    public class MyDuanZi : MyAutoCadObjectBase
    {
        MyPoint m_p1;
        public MyPoint P1
        {
            get { return m_p1; }
            set { m_p1 = value; }
        }

        MyText m_DuanZiName;
        public MyText DuanZiName
        {
            get { return m_DuanZiName; }
            set { m_DuanZiName = value; }
        }
        public MyDuanZi(MyPoint p1, MyText text, MyAutoCadObjectBase container) :
            base(p1.X + container.Left, container.Top + p1.Y, container)
        {
            m_p1 = p1;
            m_DuanZiName = text;
            m_DuanZiName.P1 = m_p1.inflate(-5, 0.5);
        }
        public override void MyDraw(MyCadDll.MyCad mycad)
        {
            base.MyDraw(mycad);
            m_DuanZiName.MyDraw(mycad);
            mycad.DrawCircleToCad(m_p1.ToScreenArray(), 1);
            mycad.DrawCircleToCad(m_p1.ToScreenArray(), 0.5);
            mycad.DrawLineToCad(m_p1.inflate(-1, -1).ToScreenArray(), m_p1.inflate(1, 1).ToScreenArray(), 1);
        }
    }
}
